﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Cart
{

    public partial class WebForm1 : System.Web.UI.Page
    {
        public class Link
        {
            public string URL { get; set; }
            public int URLType { get; set; }
            public int URLState { get; set; }
        }
        public class WebPage
        {
            public string Id { get; set; }
            public string Title { get; set; }
            public string Url { get; set; }
            public List<Link> Links { get; set; }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            WebPage[] pages = new WebPage[] 
        {
            new WebPage { Id = "foo", 
                Title = "foobar", 
                Url = "http://foo.bar", 
                Links = new List<Link> ( new Link[] {
                    new Link {URL = "http://something", URLType = 1, URLState = 2},
                    new Link {URL = "http://someotherthing", URLType = 3, URLState = 4}
                })
            },
            new WebPage { Id = "excellent", 
                Title = "excellent Title", 
                Url = "http://excellent.com", 
                Links = new List<Link> ( new Link[] {
                    new Link {URL = "http://excellent", URLType = 5, URLState = 6},
                    new Link {URL = "http://totallyexcellent", URLType = 7, URLState = 8}
                })
            }

        };
            results.DataSource = pages;
            results.DataBind();
        }
    }
}